//
//  PYPointCell.m
//  IHome
//
//   Created by zhujizheng on 2020/2/18.
//  Copyright © 2019年 com.zhujizheng. All rights reserved.
//

#import "PYPointCell.h"

@interface PYPointCell ()

@property (nonatomic, strong) UIView *pointView;

@end

@implementation PYPointCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initPointView];
        [self updatePointPosition];
    }
    return self;
}


- (void)setShowRedPoint:(BOOL)showRedPoint
{
    _showRedPoint = showRedPoint;
    if (showRedPoint) {
        self.pointView.backgroundColor = [UIColor colorWithRed:251.f/255.f green:72.f/255.f blue:72.f/255.f alpha:1];
        self.pointView.hidden = NO;
    } else {
        self.pointView.hidden = YES;
    }
}

#pragma mark - pointView
- (UIView *)pointView
{
    if (!_pointView) {
        _pointView = [UIView new];
        _pointView.layer.cornerRadius = 5;
        _pointView.layer.masksToBounds = YES;
    }
    return _pointView;
}

- (void)initPointView
{
    [self.contentView addSubview:self.pointView];
    [self.pointView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(0);
        make.width.mas_equalTo(10);
        make.height.mas_equalTo(10);
        make.centerY.mas_equalTo(0);
    }];
}

- (void)updatePointPosition
{

}
@end
